package com.example.previewvideo.util;

import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

public class WifiUtils {

    public static void getConnectedWifiInfo(Context context) {
        WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        WifiInfo wifiInfo = wifiManager.getConnectionInfo();

        if (wifiInfo != null) {
            String ssid = wifiInfo.getSSID();  // 获取 SSID
            String bssid = wifiInfo.getBSSID();  // 获取 BSSID

            System.out.println("WifiUtils SSID: " + ssid);
            System.out.println("WifiUtils BSSID: " + bssid);
        }
    }
}
